/*****************************************************************************************
Arise Engine		PolygonEdge.h

					E-mail:		arise_engine@mail.ru

					Origin by:	DK Engine Exporter (c) 2003-2006,
								KAIN (igor@donec.net), Agressor (agress0r@mail.ru)

created:			25.09.2004
last changes:		18.04.2007
*****************************************************************************************/
#pragma once

class PolygonEdge
{
private:

public:
	PolygonEdge()
	{
	}
	virtual ~PolygonEdge()
	{
	}

	///	todo int
	PolygonEdge(UINT start, UINT end)
	{
		if(start < end)
		{
			m_start	= start;
			m_end	= end;
		}
		else
		{
			m_start	= end;
			m_end	= start;
		}	
	}


	// ! m_start < m_end
	int				m_start;
	int				m_end;
	UINT			m_id;
	D3DXVECTOR3		m_start_vertex;
	D3DXVECTOR3		m_end_vertex;


	bool operator==(const PolygonEdge edge)const
	{
		if(		edge.m_start	== m_start 
			&&	edge.m_end		== m_end
			||	edge.m_start	== m_end 
			&&	edge.m_end		== m_start	)
					return true;
		return false;
	}
};


bool IsEdgeExist(PolygonEdge edge, const std::vector<PolygonEdge> &edge_list);

bool IsEdgeOutside(	UINT							edge_vertex1,
					UINT							edge_vertex2,
					const D3DXVECTOR3				&normal,
					const std::vector<D3DXVECTOR3>	&vertex_list	);

int FindNeighbourEdge(	UINT							start_vert, 
						UINT							end_vert, 
						const std::vector<PolygonEdge>	&edge_list	);


